using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Net.Fan.SmallPig.Common.DBMeta;
using Net.Fan.SmallPig.DataAccess;

public partial class Title : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack == false)
        {
            string appName = Request.Url.Segments[1];
            //if (appName.Contains(".aspx"))
            //{
            //    lnkMyBugOnline.NavigateUrl = string.Format("https://{0}/comm", Request.Url.Host);
            //    lnkLogin.NavigateUrl = string.Format("https://{0}/Login.aspx", Request.Url.Host);
            //    lnkReg.NavigateUrl = string.Format("https://{0}/UserReg.aspx", Request.Url.Host);
            //}
            //else
            //{
            //    lnkMyBugOnline.NavigateUrl = string.Format("https://{0}/{1}comm", Request.Url.Host, appName);
            //    lnkLogin.NavigateUrl = string.Format("https://{0}/{1}Login.aspx", Request.Url.Host, appName);
            //    lnkReg.NavigateUrl = string.Format("https://{0}/{1}UserReg.aspx", Request.Url.Host, appName);
            //}
            if (this.Page.User.Identity.IsAuthenticated)
            {

                pnlWelcome.Visible = true;
            
                lnkLogin.Visible = false;
            }
            else
            {

                pnlWelcome.Visible = false;
            
                lnkLogin.Visible = true;
            }
        }
    }
    protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
    {
        LogDA.AddLog(LogMeta.InformationType, string.Format("Manual logout: {0},IP: {1}", this.User.Identity.Name, Request.UserHostAddress));
    }
}
